nsTableRowGroupFrame.cpp: do not use 'else' after 'break'
Categories
(Core :: Layout: Tables, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: baka)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=C++])
Attachments
(1 file)
+++ This bug was initially created as a clone of Bug #1669833 +++
Filling as a good first bug to learn workflows.
do not use 'else' after 'break':
https://searchfox.org/mozilla-central/source/layout/tables/nsTableRowGroupFrame.cpp#1335-1347
As the change is trivial, it is just to learn how to contribute to Firefox.
Found by http://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
Updated•5 years ago
|
Hey, first-time contributor here. I had a look at the referenced lines of code. Will removing else with its parantheses, but keeping the code block inside fix the issue? Like this:
...
break;
} // if (rowRect.YMost() > availHeight)
// removed else {
aDesiredSize.Height() = rowRect.YMost();
prevRowFrame = rowFrame;
// see if there is a page break after the row
nsTableRowFrame* nextRow = rowFrame->GetNextRow();
if (nextRow && nsTableFrame::PageBreakAfter(rowFrame, nextRow)) {
PushChildren(nextRow, rowFrame);
aStatus.Reset();
aStatus.SetIncomplete();
break;
}
// removed } from else statement
...
How go about testing these trivial changes? As the code doesn't break from this mistake, it's hard for me to analyze whether it's fixed.
Reporter | ||
Comment 2•5 years ago
|
||
Sounds good, but remove the " // removed else {". we have a VCS to keep track of these changes.
For testing, just build it :)
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
Description
•